package sk.tuke.magsa.maketool.task;

import sk.tuke.magsa.maketool.PrintProvider;
import sk.tuke.magsa.maketool.State;
import sk.tuke.magsa.maketool.action.processor.LineParser;
import sk.tuke.magsa.maketool.action.MagsaContext;
import sk.tuke.magsa.maketool.ui.ActionWrapper;

public class Task1 extends AbstractTaskPanel {
    /** Creates new form Task1 */
    public Task1() {
        initComponents();
    }

    @Override
    public void configure(PrintProvider printProvider) {
        MagsaContext context = new MagsaContext();

        lineParser.addInputs(modelDir);
        lineParser.setOutput(model);        
        lineParser.setAction(new ActionWrapper(new LineParser(), context, printProvider));
    }

    @Override
    public void init() {
        modelDir.setState(State.COMPLETED);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        modelDir = new sk.tuke.magsa.maketool.component.ResourceComponent();
        model = new sk.tuke.magsa.maketool.component.ResourceComponent();
        lineParser = new sk.tuke.magsa.maketool.component.ExecutableResourceComponent();
        arrow14 = new sk.tuke.magsa.maketool.component.Arrow();
        arrow2 = new sk.tuke.magsa.maketool.component.Arrow();
        jLabel3 = new javax.swing.JLabel();

        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("sk/tuke/magsa/maketool/Bundle"); // NOI18N
        modelDir.setLabel(bundle.getString("modelDir")); // NOI18N
        add(modelDir, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 70, 105, 55));

        model.setLabel(bundle.getString("model")); // NOI18N
        add(model, new org.netbeans.lib.awtextra.AbsoluteConstraints(670, 70, 70, 60));

        lineParser.setActionName(bundle.getString("parse")); // NOI18N
        lineParser.setLabel(bundle.getString("lineParser")); // NOI18N
        add(lineParser, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 70, 100, 60));
        add(arrow14, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 90, 50, 20));

        arrow2.setBarbStyle(sk.tuke.magsa.maketool.component.Arrow.BarbStyle.FILLED);
        add(arrow2, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 90, 50, 20));

        jLabel3.setBackground(new java.awt.Color(241, 182, 139));
        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText(bundle.getString("parsingPhase")); // NOI18N
        jLabel3.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel3.setOpaque(true);
        add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1070, 530));
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private sk.tuke.magsa.maketool.component.Arrow arrow14;
    private sk.tuke.magsa.maketool.component.Arrow arrow2;
    private javax.swing.JLabel jLabel3;
    private sk.tuke.magsa.maketool.component.ExecutableResourceComponent lineParser;
    private sk.tuke.magsa.maketool.component.ResourceComponent model;
    private sk.tuke.magsa.maketool.component.ResourceComponent modelDir;
    // End of variables declaration//GEN-END:variables
}
